package com.hnevc.vx;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class SheZhiActivty extends AppCompatActivity {

    private LinearLayout qiehuan;
    private AlertDialog alertDialog;
    private ImageView fahui;

    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activitt_shezhi);
        initView();
        initData();
        initEvent();
    }

    private void initView() {

        qiehuan = findViewById(R.id.qiehuan);
        fahui = findViewById(R.id.shezhi_return_btn);
    }

    private void initData() {

    }

    private void initEvent() {
        qiehuan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                AlertDialog.Builder builder = new AlertDialog.Builder(SheZhiActivty.this)
                        .setTitle("切换账号")
                        .setIcon(R.mipmap.ic_launcher)
                        .setMessage("是否确定切换账号")
                        .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialogInterface, int i) {
                                Intent intent = new Intent(SheZhiActivty.this, LoginActivity.class);
                                startActivity(intent);
                                alertDialog.dismiss();
                            }
                        }).setNegativeButton("取消", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialogInterface, int i) {
                                alertDialog.dismiss();
                            }
                        });
                alertDialog = builder.create();
                alertDialog.show();

            }
        });
        fahui.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(SheZhiActivty.this,ShouyeActivity.class);
                startActivity(intent);
            }
        });

    }



}
